home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Graphics 2D / Color Picker / ReadMe < prev   
Encoding:
Text File  |  2000-09-28  |  2.6 KB  |  33 lines  |  [TEXT/ttxt]

  1. Read Me About...Color Picker
  2. date 08/2000
  3.  
  4. This application demonstrates how to use the color    picker package to dynamically change colors in a    custom palette.  The program basically displays 16    squares, each representing a separate entry in the    palette.  Clicking the mouse in any box allows the    user to redefine that box's color with the color    picker package routines.  The trap ActivatePalette    is called after each color change to guarantee the    window is updated with the palette changes.  Without this safeguard, random results may occur and the    color change may not take affect until the window    has physically changed or moved.  Finally, the first    and last entries in the palette cannot be changed    and are always defined to black and white.  This is    done because ActivatePalette will only update 14    non-b/w Tolerant colors (254 in 256-color mode).  The remaining 2 colors    if defined as b/w will be updated, otherwise QD will    return the color in the palette which is the closest    match to the RGB values of these entries.
  5.  
  6. Building the Code
  7. This project was built and tested on CodeWarrior 2.1 using CarbonLib 1.1a3.  Since this is a Carbon app, the "Carbon Support" folder of the CarbonSDK should be in the same folder as the CodeWarrior IDE.  If this is not the case, the CarbonLib library will have to be re-added to the project.  In addition, the CarbonLib extension needs to be in the extension folder.  The CarbonSDK (which contains the library and the extension) can be found on Apple's website:  http://developer.apple.com/sdk/
  8.  
  9. Restrictions
  10. Nearly every sample requires more memory than the 384KB CodeWarrior sets as the default heap size.  If for some reason the memory has been reset to the default (either through converting the project or whatever) the memory should be reset to 1000 - 2000KB (depending on the application).  This can be achieved by going to the projects settings (Edit Menu->C-PPC Settings... under CodeWarrior 2.1) and selecting the "PPC Target" under the "Target" tab.
  11.  
  12. Other Code Notes
  13. This sample used to be a "non-Carbon" sample, but has been carbonized for demonstration purposes.  The "old" code has been left in (commented out) in order to compare and contrast the Carbon versus non-Carbon APIs.
  14.  
  15. Known Bugs
  16. No known bugs.
  17.  
  18. Possible Future Enhancements
  19. None at present.
  20.  
  21. Other Sources of Reference
  22. Additional sample code can be found at:
  23. http://developer.apple.com/samplecode/
  24. in addition, the Carbon API can be found at:
  25. http://developer.apple.com/techpubs/carbon/carbon.html
  26.  
  27. Version History
  28. See source for version history.
  29.  
  30. Author
  31. JM - Apple Developer Technical Support - dts@apple.com
  32.  
  33.